package com.simple.datax.bo.impl;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.simple.datax.bo.IDataxDictionaryCatagoryBO;
import com.simple.datax.dao.IDataxDictionaryCatagoryDAO;
import com.simple.datax.vo.DataxDictionaryCatagoryVO;

@Service("dataxDictionaryCatagoryBO")
@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
public class DataxDictionaryCatagoryBOImpl implements IDataxDictionaryCatagoryBO {

	@Autowired
	private IDataxDictionaryCatagoryDAO dataxDictionaryCatagoryDAO;
	
	@Override
	public DataxDictionaryCatagoryVO findById(final Integer id) {
		return dataxDictionaryCatagoryDAO.findById(id);
	}

	@Override
	public List<DataxDictionaryCatagoryVO> findAll() {
		return dataxDictionaryCatagoryDAO.findAll();
	}

	@Override
	public Map<String, String> getCatagory() {
		final Map<String, String> catMap = new LinkedHashMap<String, String>();
		final List<DataxDictionaryCatagoryVO> dataxDictionaryCatagoryVOList = findAll();
		for(final DataxDictionaryCatagoryVO vo : dataxDictionaryCatagoryVOList){
			catMap.put(String.valueOf(vo.getFiId()), vo.getFcName());
		}
		return catMap;
	}

	


}
